package code.structure.module.scene.model.data 
{
	/**
	 * 当前场景的人物信息
	 * @author CYang
	 */
	public class SceneUserData 
	{
		/**
		 * 用户ID
		 */
		public var uId:String;
		
		public var coins:int;
		
		public var cash:int;
		
		public var exp:int;
		
		public var socailmoney:int;
		
		/**
		 * 商店名字
		 */
		public var shopName:String;
		/**
		 * 访问能量  
		 */
		public var energy:int;
		/**
		 * 用户名字
		 */
		public var userName:String;
		/**
		 * 粉红星
		 */
		public var redStar:int;
		/**
		 * 普通星级(黄星)
		 */
		public var nomalStar:int;
		/**
		 * 装饰值
		 */
		public var decoration:int;
		/**
		 * 粉丝值
		 */
		public var favourable:int;
		
		public var power:int;
				
		public var level:int;
		/**
		 * 解锁的地块
		 */
		public var unlockArea:Array;
		/**
		 * 最大刷新数据
		 */
		public var maxRefresh:int;
		/**
		 * 今天是否刷新
		 */
		public var bRandom:Boolean;
		/**
		 * 访问剩余次数(前20个有奖励)
		 */
		public var last_vist_times:int;
		
		
		public function SceneUserData(data:Object) 
		{
			if(!data) return;
			uId = data.uid;
			shopName = data.shop_name || " ";
			cash = data.cash;
			coins = data.coin;
			exp = data.exp;
			power = data.power;
			level = data.level;
			socailmoney = data.socialmoney;
			userName = data.user_name;
			if(!userName) userName = ' ';
			energy = data.friend_power;	
			nomalStar = data.cook_base_level;
			redStar = data.cook_high_level;
			decoration = data.decoration;
			favourable = data.popularity;
			if(data.map_unlock) unlockArea = JSON.parse(data.map_unlock) as Array;
			maxRefresh = data.max_random;
			bRandom = int(data.today_israndom) == 1;
			last_vist_times = data.visit_frinend_times;
		}
		
	}

}